<?php
abstract class PageElement
{
	protected $name;
	protected $value;
	protected $text;
	protected $cssClass;
	protected $onChange;
	protected $onClick;
	protected $onMouseOver;
	protected $onMouseOut;
	protected $parentPage;
	protected $disabled = false;

	public function getHTML()
	{
		$html = "";
		if($this->cssClass)
			$html .= " class=\"".$this->cssClass."\"";
		if($this->name)
			$html .= " id=\"".$this->name."\"";
		if($this->name)
			$html .= " name=\"".$this->name."\"";
		if(isset($this->value))
			$html .= " value=\"".$this->value."\"";
		if($this->onChange)
			$html .= " onchange=\"".$this->onChange."\"";
		if($this->onClick)
			$html .= " onclick=\"".$this->onClick."\"";
		if($this->onMouseOver)
			$html .= " onmouseover=\"".$this->onMouseOver."\"";
		if($this->onMouseOut)
			$html .= " onmouseout=\"".$this->onMouseOut."\"";
		if($this->disabled)
			$html .= " disabled=\"disabled\"";
		return $html;
	}

	public function setDisabled($disabled)
	{
		$this->disabled  = $disabled;
	}

	public function setParentPage($parentPage)
	{
		$this->parentPage  = $parentPage;
	}

	public function getParentPage()
	{
		return $this->parentPage;
	}

	public function setText($text)
	{
		$this->text = $text;
	}

	public function setName($name)
	{
		$this->name = $name;
	}

	public function getName()
	{
		return $this->name;
	}

	public function setValue($value)
	{
		$this->value = $value;
	}

	public function setCSSClass($class)
	{
		$this->cssClass = $class;
	}

	public function setOnChange($onChange)
	{
		$this->onChange = $onChange;
	}

	public function setOnClick($onClick)
	{
		$this->onClick = $onClick;
	}

	public function setOnMouseOver($onMouseOver)
	{
		$this->onMouseOver = $onMouseOver;
	}

	public function setOnMouseOut($onMouseOut)
	{
		$this->onMouseOut = $onMouseOut;
	}

}
?>